﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace ServiceHost
{
    class Program
    {
        private static ServiceHost host;

        [MTAThread]
        static void Main(string[] args)
        {
            if (args.Length == 2 && (args[0] == "start" || args[0] == "stop"))
            {
                host = new ServiceHost((args[0] == "start") ? true : false, args[1]);
                if (host.ServiceGuid != null)
                {
                    host.Start();
                }
            }
            else System.Windows.Forms.MessageBox.Show("Usage: ServiceHost [start|stop] [service.dll]");
        }
    }
}
